<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>打开定时器查看结果</div>

    <script>
        console.log('======Promise.reject()========');
        /*
           Promise.reject()返回一个新的Promise实例，该实例的状态为rejected
        */
       let p = Promise.reject('错误信息')
       p.catch(err=>console.log(err))
       // 等同于
       let p2 = new Promise((resolve,reject)=>{
        reject('错误信息2')
       })
       p2.catch(err=>console.log(err))
    </script>
</body>
</html>